import 'package:flutter/material.dart';

class ListView02 extends StatelessWidget {
  const ListView02({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    const divider1 = Divider(color: Colors.blue,);
    const divider2 = Divider(color: Colors.green,);
    return Scaffold(
      appBar: AppBar(title: const Text("list view 02"),),
      body: ListView.separated(
        itemCount: 200,
        separatorBuilder: (BuildContext context, int index) {
          return index % 2 == 0 ? divider1 : divider2;
        },
        itemBuilder: (BuildContext context, int index) {
          return ListTile(title: Text("$index"),);
        },
      ),
    );
  }
}